﻿using Microsoft.AspNetCore.Builder;
using Sayook.Framework.AOP.Middleware;

namespace Sayook.Framework.AOP
{
    /// <summary>
    /// 中间件扩展类
    /// </summary>
    public static class MiddlewareExtensions
    {
        /// <summary>
        /// 添加通用中间件
        /// </summary>
        /// <param name="builder"></param>
        /// <returns></returns>
        public static IApplicationBuilder UseGenericMiddleware(this IApplicationBuilder builder)
        {
            builder.UseMiddleware<CatchExceptionMiddleware>();

            return builder;
        }
    }
}